function Map(obj) {
    this.keys = [];
    this.data = {};

    this.containByKey=function(key){
        if(this.keys.indexOf(key) != -1){
            return true;
        }
        return false;
    };
    this.put = function(key, value) {
        if(isEmpty(key)) {
            return;
        }
        if(!this.containByKey(key)){
            this.keys.push(key);
        }
        this.data[key] = value;
    };
    this.get = function(key) {
        if(this.containByKey(key)){
            return this.data[key];
        }
        return null;
    };
    this.remove = function(key) {
        if(this.containByKey(key)){
            this.keys.remove(key);
            this.data[key] = null;
        }
    };

    this.each = function(fn){
        if(typeof fn != 'function'){
            return;
        }
        var len = this.keys.length;
        for(var i=0;i<len;i++){
            var k = this.keys[i];
            fn(k,this.data[k],i);
        }
    };
    this.values = function(){
        var values = {};

        var len = this.keys.length;
        for(var i=0;i<len;i++){
            var key = this.keys[i];
            var value=this.data[key];
            values[key]=value;
        }
        return values;
    } ;
    this.isEmpty = function() {
        return this.keys.length == 0;
    };

    this.size = function(){
        return this.keys.length;
    };

    this.toString = function(){
        return this.toJSONString();
    };
    this.toJSONString = function(){
        return JSON.stringify(this.values());
    };


    if(obj != null){
        for(var key in obj){
            var value = obj[key];
            this.put(key,value);
        }
    }
}